public class Test04_1 {
    public static void main(String[] args) {
        String string = "hello word world";
        StringBuffer stringBuffer = new StringBuffer();
        for(int i = 0;i<string.length();i++){
            if (string.charAt(i)==' ') stringBuffer.append("%20");
            else stringBuffer.append(string.charAt(i));
        }
        System.out.println(stringBuffer.toString() + " "+stringBuffer.length());
    }
}
